#include-once

Local $__gScintilla_idDll

Func Scintilla_Init()
	Static $sDllPath
	If (IsDeclared('gnSCINTILLA_SCIPATH')) Then
		$sDllPath = Eval('gnSCINTILLA_SCIPATH')
	Else
		$sDllPath = 'SciLexer.dll'
	EndIf
	Local $idDll = DllOpen($sDllPath)
	OnAutoItExitRegister(__Scintilla_Finalize)
	Return $idDll
EndFunc

Func __Scintilla_Finalize()
	DllClose($__gScintilla_idDll)
EndFunc
